package com.kang.dao;

import java.util.List;

import org.apache.ibatis.annotations.Param;

import com.kang.pojo.PurchaseRequest;
import com.vonechina.entity.page.PurchaseRequestPage;

/**
 * 采购申请持久层
 * 
 * @author zs614
 *
 */
public interface PurchaseRequestMapper {
	/**
	 * 删除采购申请
	 * 
	 * @param purchaserequisitionid
	 *            采购申请ID
	 * @return
	 */
	int deleteByPrimaryKey(Integer purchaserequisitionid);

	/**
	 * 新增采购申请
	 * 
	 * @param pur
	 *            采购申请实体类
	 * @return
	 */
	Integer insertSelective(PurchaseRequest pur);

	/**
	 * 查询采购申请最大编号
	 * 
	 * @return
	 */
	String selectMaxApplication();

	/**
	 * 通过主键查询采购申请
	 * 
	 * @param purchaserequisitionid
	 *            采购申请ID
	 * @return
	 */
	PurchaseRequest selectByPrimaryKey(Integer purchaserequisitionid);

	/**
	 * 更新采购申请
	 * 
	 * @param record
	 *            采购申请实体类
	 * @return
	 */
	int updateByPrimaryKey(PurchaseRequest record);

	/**
	 * 保存采购申请状态
	 * 
	 * @param purchaseRequisitionID
	 *            采购申请ID
	 * @param status
	 *            状态
	 * @return
	 */
	Integer updateStatus(@Param("purchaseRequisitionID") Integer purchaseRequisitionID,
			@Param("status") Integer status);

	/**
	 * 提交采购申请
	 * 
	 * @param purchaseRequisitionID
	 *            采购申请ID
	 * @return
	 */
	Integer submitRequest(Integer purchaseRequisitionID);

	/**
	 * 分页查询采购申请
	 * 
	 * @param page
	 *            搜索条件实体类
	 * @return
	 */
	List<PurchaseRequest> listPurchaseRequest(PurchaseRequestPage page);

	/**
	 * 查询采购申请条数
	 * 
	 * @param page
	 *            搜索条件实体类
	 * @return
	 */
	Integer countPurchaseRequest(PurchaseRequestPage page);
}